The online racing simulator
Searching in All forums
(951 results)
Yisc[NL]
S3 licensed
Quote from rane_nbg :Or adding physics to a moving subobjects, enabling us to create working machines, like planes, caterpilar/crane wehicles.

This nonsense has gone way too far already in my opinion.
LFS is a racing simulator.
What's next?
Being able to use the cranes to build houses, factories, racing circuits or to fly planes in and out the racing track?
There should be one focus and one focus only from now on and that's new tyre physics and the graphics update.
Yisc[NL]
S3 licensed
The error causing the crash is in the 4rd line (6th if you count the empty ones as well): The specified string is not in the form required for an e-mail address.

Somewhere an emailadress is put into Lapper and not in the correct format.
Yisc[NL]
S3 licensed
Ah, well thought of and even a better solution than mine.
Yisc[NL]
S3 licensed
As I think that you already have created a loop to go through the content of the file, you should add SplitToArray to that loop.
The value to make the split on will be "=" which will then give you an array for each line, with the following content in the array for each line read:

position 0 of the array: name of the value
position 1 of the arry: value

Example:

position 0 of the array: ban
position 1 of the arry: 0
Yisc[NL]
S3 licensed
Maybe I am a bit cranky today, but what do you expect?

You came here with a question about something you have seen on a server.
You have not made any effort your self.
You got help from two people that know what they are doing when it comes to Lapper scripts.

First example you try and does not work as you want.
Second example does certainly work, but you want it differently.
Then you make no effort again, but expect help from us/others.

This is not the way to learn things.
Have a go at the code, debug it properly and if you really get stuck, show what you have, what the error is, etc.
Yisc[NL]
S3 licensed
Well, you can use my code and strip the GUI out of it.
Shouldn't be too hard to accomplish.
Yisc[NL]
S3 licensed
I wrote and admin chat back in the day.
Cannot remember if I ever shared it, but here it is.
Rename the file to *.lpr and make sure to add it to addonsused.lpr

The message that have been written are into a file called "Adminchat.txt" in the current, code but both the location and the name of the file can be changed of course.
To keep track of the messageID, that value is stored in the Lapper database.
The chat can be started using "!adminchat" or "!adchat"
I'm supplying the code as is, so don't ask for changes, new features, etc.
Yisc[NL]
S3 licensed
Quote from Bass-Driver :Could you explain what you did. With a examplecode
Could be helpfull for other lapperusers

He fixed the image size, not the actual problem he asked help for (if I am understanding things correctly).
Yisc[NL]
S3 licensed
Im am not into mods at all, but maybe updates need to be approved before being visible?
Yisc[NL]
S3 licensed
Quote from Bass-Driver :I havent see anyone using LFSLapper locally, so do not know if it actually works.

When the AB.nl server were running on a LFS server, I hosted Lapper from my home.
Made it connect to the correct IP address and portnumber and whitelisted my home IP address in the LFS server settings.
Worked flawless.
Yisc[NL]
S3 licensed
Quote from ronhill_lights :Ok but i downloaded the file and i eneter it in my Lfs editor map,but Microsoft Defender says that this app is unknown and it may be dangerous to my computer

That's what they call "a false positive" so can be ignored.
Yisc[NL]
S3 licensed
I don't think there is anything you can do to solve that. Many programs have scheduled checks to see if there's an update, to run a security scan, etc. etc.
Make sure to restart your computer every day, so that checks/updates/scans are done as often as possible and if things are slow, then check taskmanager to see if anything special comes up.
Yisc[NL]
S3 licensed
My educated guess is that one or more processes in the background are consuming CPU time and therefor the low end machine runs below its normal capacity. Windows updates can be cause, which are distributed by Microsoft once a month (2nd Tuesday) but updates and/or checks for other updates can cause this as well.
Yisc[NL]
S3 licensed
Lapper should keep updating the information stored in the CSV file.
Then the website will show the latest data when loading or refreshing the page.
A refresh can be done automatically using a header, but don't know if Wordpress allows or can use that, as I build my websites without such tools).
Yisc[NL]
S3 licensed
If Lapper keeps updating the CSV file and that file is on the actual webserver, it will always be up-to-date.
Yisc[NL]
S3 licensed
Quote from neron59 :I may have done something wrong but it doesn't work.
I'll try again tomorrow Smile

Probably, as I know for sure (100%) that it works. Smile
Yisc[NL]
S3 licensed
Right, I had to get up to speed again, but it's done.
Here's all the code you need.

First the CASE:


CASE "!5":
Globalvar $Seconds;
Globalvar $DisplaySeconds;
Globalvar $Minutes;
Globalvar $start_race_seconds;

$Seconds = 0;
$DisplaySeconds = 0;
$Minutes = 0;
$start_race_seconds = 300;

calc_race_start_time( 0,0 );
BREAK;

Then the sub-event to calculate the time:


Sub calc_race_start_time( $KeyFlags,$id )
$Minutes = round(($start_race_seconds/60),0);
$Time = (round(($start_race_seconds/60),2)-$Minutes);
$Seconds = round(($Time*60),0);

IF ( $Seconds < 0 )
THEN # when seconds are negative
$Minutes = $Minutes-1;
$Seconds = 60 + $Seconds;
ENDIF

$DisplaySeconds=$Seconds;

Timer( $KeyFlags );#Goto Countdowntimer
EndSub

Then the actual button to display the time:


Sub Timer( $KeyFlags )
### Display button ###
openGlobalButton( "countdown_button",78,60,82,20,13,-1,16,"^3Race starts in " . $Minutes . " minutes and " . $DisplaySeconds . " seconds" );
### End ###

### Reduce seconds by 1 ###
### If seconds are below 0, reduce minutes by 1 and set seconds back to 59 ###
### If seconds are below 10, add a leading 0 to the displayed value ####
$Seconds = $Seconds-1;

IF ( $Seconds < 0 )
THEN
$Minutes = $Minutes-1;
$Seconds = 59;
ENDIF

IF ( $Seconds < 10 )
THEN
$DisplaySeconds="0".$Seconds;
ELSE
$DisplaySeconds=$Seconds;
ENDIF
### End ###

### If minutes and seconds are greater then or equal to 0, use the 1 second loop, else close button ###
IF ( $Minutes >= 0 && $Seconds >=0 )
THEN
HostDelayedCommand( 1, Timer );
ELSE
closeGlobalButton( "countdown_button" );
ENDIF
### End ###
EndSub

Yisc[NL]
S3 licensed
The code you found uses PHP functions (time, $_SESSION) that are not available in Lapper, so this will never work.
I will write the code when I get home, which is about half an hour from now.
Yisc[NL]
S3 licensed
Let us know if you got it to work, as it might help others at some point as well.

*edit*

I see that the code uses PHP functions which are not in Lapper.
So I think this won't work.
I will try to write the code as soon as I get home (in about 1,5 hour from now) and then post it here.
Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
Quote from rane_nbg :In order to create a countdown timer, you have to make a timer of some sort, a function that can read system time, I don't know how this is done in PHP.

Then you can make an event or a function that gets called when each second passes and increment your time variable. After that, you show your button with the message. After a certain preset time has passed you should no longer call the timer function.

First, the question is not about PHP but about Lapper.
I wrote my code between PHP-tags to present them properly on this forum, that's all/
Second, if you are not helping but only trying to wind someone up or even worse, make them drop their question and efforts because of not getting answers, you are not helping and it would be better not to answer.
Yisc[NL]
S3 licensed
It's not possible with that function, but of course you could easily construct the correct code.

<?php 
CASE "!5":
$race_start_time_sec=300;
$race_start_minutes = $race_start_time_sec /60;

openGlobalButton( "countdown_button",78,60,42,20,13,-1,16,"^3Race starts in" . $race_start_minutes. " minutes", race_start_timer);
BREAK;
?>
Then you need to create an event called "race_start_timer".
In that event you lower $race_start_time_sec by one.
Then you need to calculated the minutes and minutes again, update the button and call the same event again.

Am doing this just from my head, so the code isn't tested.
Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
Congrats on this update Scawen. I have seen how hard you worked on them, along the LFS community. Wishing you (Eric and Victor as well) happy holidays. Get some good rest, as you deserve that soooo much.
Yisc[NL]
S3 licensed
If I remember correctly, the shortest interval you can use is one second.
With DelayedCommand you can jump from one event to another and then back to the first event.
This way you can display those buttons with an interval of 1 second.
Yisc[NL]
S3 licensed
Your comment is a bit weird, probably because of a translation issue.
I am guessing you mean that no global message is send when someone is spectated.
That's because "privMsg" is used, which sends a private message to the play involved.
To send the message to everyone, just use "GlobalMsg"
Yisc[NL]
S3 licensed
@Bass-Driver: sorry chief Wink
FGED GREDG RDFGDR GSFDG